lure: ensure metadata gaps are filled when generating links#5841
Merged
Conversation
Two related fixes to lure open-graph metadata. %reel-describe now backfills missing fields from server state when the caller's describe is sparse: title/description/image scried from %groups, and nickname/avatar from our cached profile. Caller-provided values always win, and scry failures are tolerated via mole. This lets pioneer create lures with a bare describe and still get a fully populated preview, instead of relying on later subscription updates. The "a Groupchat" fallback in the og-title formula was unconditional in the no-nickname branch, ignoring a real group title when one was present. It now uses group-title (which itself still falls back to "a Groupchat" when the title is empty), so a titled group renders "You're Invited to <Title>" instead of "You're Invited to a Groupchat". Tests gain a scry mock returning an empty group:v9:gv for the gap-fill path, and the test-groups-update expectation is updated to reflect the corrected fallback behavior. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Two call sites in the /contacts and /groups subscription handlers were computing the same group-invite open-graph title. Extracted the formula (including the "a Groupchat" fallback) into a single helper in the upper |% core. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
Fang-
reviewed
May 14, 2026
Member
Fang-
left a comment
There was a problem hiding this comment.
Some safety concerns for the stuff you tried making safe. Looks good otherwise!
mikolajpp
approved these changes
May 15, 2026
Collaborator
mikolajpp
left a comment
There was a problem hiding this comment.
The changes look good, the logic is sound.
A few coding nits, but that's about it!
Fang-
approved these changes
May 15, 2026
Member
Fang-
left a comment
There was a problem hiding this comment.
Changes look good, thank you. Concur with @mikolajpp's comments.
Rename helpers (blank -> is-blank, gt -> title, gmeta -> meta, fld -> fields), tighten is-blank's key to field:reel, and switch the gap-fill block to =* aliasing so is-blank re-evaluates against the current fields binding. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
%reel had a bug whereby empty nicknames wouldn't fill with any existing group title, minor but still good to fix. The other piece here is making sure we always fill in any gaps in the metadata. %reel has drifted into being more heavily integrated into groups/contacts and this just furthers that by making sure any kind of reel describe calls actually fill in gaps in the metadata from what we have on the backend. This was present in https://github.com/tloncorp/ylem/blob/8af770c82083f1031c84b72a877a7b8ad226c56f/pkg/runtime/pioneer/src/Pioneer/Command/Click.hs#L1537 where we're only giving
userId,type, andgroupId.Fixes TLON-5790
Changes
%reel-describegap-filling (desk/app/reel.hoon): when a caller's describe is sparse, backfill missing open-graph fields from server state —invitedGroupTitle/invitedGroupDescription/invitedGroupIconImageUrlscried from%groups, andinviterNickname/inviterAvatarImageread from reel's cachedour-profile. Caller-provided values always win; the group scry is wrapped inmoleso a missing group doesn't crash the poke.group-title(which itself still falls back to "a Groupchat" when the title is empty).group-og-titlehelper: extracted the formula shared by the/contactsand/groupssubscription handlers into a single helper in the upper|%core. No behavior change.desk/tests/app/reel.hoon): added a scry mock returning an emptygroup:v9:gvfor the gap-fill path, wired it into the three tests that exercise%reel-describe(test-reel-describe,test-groups-update,test-contacts-update). Updated thetest-groups-update$og_titleexpectation to reflect the corrected fallback ("You're Invited to Early Sunrise"instead of"…a Groupchat").How did I test?
Ran
./backend/run-tests.shlocally against a moon— all three reel tests pass (test-reel-describe,test-groups-update,test-contacts-update). No e2e or client changesRisks and impact
%reelagent)Rollback plan
Revert the merge commit. The agent state-version is unchanged, so no migration concerns. Any lures registered while this is live keep their backfilled metadata fields, which is forward-compatible with the prior code path (extra fields are just ignored downstream if reverted).
Screenshots / videos
N/A — backend / Hoon only. The user-visible effect is open-graph previews on shared invite links: titles like "Tlon Messenger: You're Invited to <Group Title>" instead of "…to a Groupchat" when the inviter has no nickname yet.